import request from "@/utils/request";
const BASE_URL = "wblog_user";
export default {
  /**
   * 分页查询
   * @param {*} page
   * @param {*} size
   * @param {*} searchMap
   */
  searchPage(page, size, searchMap) {
    return request({
      url: `${BASE_URL}/user/search/${page}/${size}`,
      method: "post",
      data: searchMap
    });
  },
  /**
   * 拉黑用户
   * @param {*} userId
   */
  blackUser(userId) {
    return request({
      url: `${BASE_URL}/user/black/${userId}`,
      method: "put"
    });
  },
 
  /**
   * 根据id查询用户信息
   * @param {*} id
   */
  getById(id) {
    return request({
      url: `${BASE_URL}/user/${id}`,
      method: "get"
    });
  },

  
  
 
  /**
   * 修改用户信息
   * @param {*} pojo
   */
  update(pojo) {
    return request({
      url: `${BASE_URL}/user/${pojo.id}`,
      method: "put",
      data: pojo
    });
  },
  /**
   * 后台添加用户
   * @param {*} pojo
   */
  addUser(pojo) {
    return request({
      url: `${BASE_URL}/user`,
      method: "post",
      data: pojo
    });
  },
  /**
   * 上传头像
   * @param {} file
   */
  upload(file) {
    return request({
      url: `${BASE_URL}/user/upload`,
      method: "post",
      data: file
    });
  },
 
};
